From: kaf24@firebug.cl.cam.ac.uk Date: Tue, 30 May 2006 17:47:37 +0000 (+0100) Subject: Fix PAE debug builds to avoid shadowing shadow-mode pgdirs below 4GB. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16013^2~16 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=d9b9ff1fcdb9d27e53a279d5d86d702a0ddb0883;p=xen.git Fix PAE debug builds to avoid shadowing shadow-mode pgdirs below 4GB. The current shadow mode is not aware of this extra level of shadowing and gets rather confused. Furthermore it *always* ensures that its PAE pgdirs are below 4GB so there is no need for the extra shadowing logic to be invoked. This fixes a bug introduced in changeset 10177:d5f98d23427a0d256b896fc63ccfd2c1f79e55ba Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 29e72dea30..622b9505dc 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -266,8 +266,15 @@ void share_xen_page_with_privileged_guests( /* Only PDPTs above 4GB boundary need to be shadowed in low memory. */ #define l3tab_needs_shadow(mfn) (mfn >= 0x100000) #else -/* In debug builds we aggressively shadow PDPTs to exercise code paths. */ -#define l3tab_needs_shadow(mfn) ((mfn << PAGE_SHIFT) != __pa(idle_pg_table)) +/* + * In debug builds we aggressively shadow PDPTs to exercise code paths. + * We cannot safely shadow the idle page table, nor shadow-mode page tables + * (detected by lack of an owning domain). Always shadow PDPTs above 4GB. + */ +#define l3tab_needs_shadow(mfn) \ + ((((mfn << PAGE_SHIFT) != __pa(idle_pg_table)) && \ + (page_get_owner(mfn_to_page(mfn)) != NULL)) || \ + (mfn >= 0x100000)) #endif static l1_pgentry_t *fix_pae_highmem_pl1e;